import Vue from "vue";
import VeeValidate from 'vee-validate'
//引入中文包，提示为中文提示
import zh_CN from 'vee-validate/dist/locale/zh_CN' 
Vue.use(VeeValidate)
//具体规则
VeeValidate.Validator.localize('zh_CN', {
    messages: {
        //将中文语言包中的messages提示配置
        ...zh_CN.messages
    },
    attributes:{
        //key是输入项的name属性，value是具体中文名
        phone:'手机号',
        code:'验证码',
        password:'密码',
        rePassword:'确认密码',
        agree:'用户协议'
    }
})
//自定义一个规则：need
VeeValidate.Validator.extend('need',{
    validate:value=> value,
    getMessage:field=> field+'必须同意'
})
